package com.beagle.njddapp.base;



import com.beagle.njddapp.bean.CompanyBean;
import com.beagle.njddapp.bean.InvateBean;
import com.beagle.njddapp.bean.JszBean;
import com.beagle.njddapp.bean.LoginBean;
import com.beagle.njddapp.bean.OcrIdBean;
import com.beagle.njddapp.bean.OcrIdPhotoBean;
import com.beagle.njddapp.bean.RoleBean;
import com.beagle.njddapp.bean.StringBean;
import com.beagle.njddapp.bean.UpdateBean;
import com.beagle.njddapp.bean.UploadBean;
import com.beagle.njddapp.bean.UserInfoBean;
import com.beagle.njddapp.bean.VersionBean;
import com.beagle.njddapp.bean.WxPayBean;
import com.beagle.njddapp.bean.ZdBean;
import com.beagle.njddapp.bean.ZkBean;
import com.beagle.njddapp.net.BaseHttpListResponse;
import com.beagle.njddapp.net.BaseHttpResponse;
import com.beagle.njddapp.net.BaseOilHttpListResponse;
import com.beagle.njddapp.net.BaseOilHttpResponse;
import com.beagle.njddapp.net.BaseStringResponseBean;
import com.beagle.njddapp.net.BaseZdHttpListResponse;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 */

public interface ApiService {



    /**
     * 登录-获取验证码
     * @return
     */
    @POST("njdd/api/app/user/send/loginsms")
    Observable<String> getMsg(@Body RequestBody body);

    /**
     * 登录-注册
     * @return
     */
    @POST("njdd/api/app/user/login")
    Observable<BaseHttpResponse<LoginBean>> login(@Header("phoneVersion") String phoneVersion,@Header("systemVersionNumber") String systemVersionNumber, @Body RequestBody body);


    /**
     * 登录-修改密码
     * @return
     */
    @POST("njdd/api/app/user/update/pwd")
    Observable<BaseHttpResponse<LoginBean>> resetPwd(@Body RequestBody body);


    /**
     * 登录-获取验证码
     * @return
     */
    @GET("njdd/api/app/user/role/list")
    Observable<BaseHttpListResponse<RoleBean>> getRole();



    /**
     * 登录-获取验证码
     * @return
     */
    @GET("app/api/userMgt/inviteeCount")
    Observable<InvateBean> inviteeCount();

    /**
     * 登录-注册
     * @return
     */
    @POST("njdd/api/app/user/select/role")
    Observable<BaseHttpResponse> selectRole(@Body RequestBody body);



    /**
     * 意见反馈
     * @return
     */
    @POST("app/api/common/feedback")
    Observable<BaseOilHttpResponse> feedback(@Body RequestBody body);



    /**
     * requestFormToken
     * @return
     */
    @POST("app/api/common/requestFormToken")
    Observable<BaseStringResponseBean> requestFormToken(@Body RequestBody body);



    /**
     * wx支付
     * @return
     */
    @POST("app/api/pay/order")
    Observable<WxPayBean> wxOrder(@Body RequestBody body);

    /**
     * ali支付
     * @return
     */
    @POST("app/api/pay/order")
    Observable<StringBean> aliOrder(@Body RequestBody body);


    /**
     * 登记基础信息
     * @return
     */
    @POST("njdd/api/app/user/register/information")
    Observable<BaseHttpResponse> information(@Body RequestBody body);

    /**
     * 字典
     * @return
     */
    @POST("app/api/common/queryDictListByName")
    Observable<BaseZdHttpListResponse<ZdBean>> queryDictListByName(@Body RequestBody body);



    /**
     * 支付前查询订单支付信息
     * @return
     */
    @GET("app/api/pay/prePaymentInfo/{orderId}")
    Observable<BaseOilHttpResponse<ZkBean>> discountMgt(@Path("orderId") String orderId);


    /**
     * 支付后查询支付结果
     * @return
     */
    @GET("app/api/pay/paymentInfo/{orderId}")
    Observable<BaseOilHttpResponse<ZkBean>> paymentInfo(@Path("orderId") String orderId);

    /**
     * 修改基础信息
     * @return
     */
    @POST("njdd/api/app/user/update/information")
    Observable<BaseHttpResponse> updateUserInfo(@Body RequestBody body);


    /**
     * 获取用户信息
     * @return
     */
    @GET("njdd/api/app/user/info")
    Observable<BaseHttpResponse<UserInfoBean>> getUserInfo();



    /**
     * 检查更新
     * @return
     */
    @GET("app/api/versionMgt/newVersion")
    Observable<UpdateBean> newVersion();



    /**
     * 检查更新
     * @return
     */
    @DELETE("app/api/userMgt/user")
    Observable<BaseHttpResponse> userExit();




    /**
     * 获取用户信息
     * @return
     */
    @GET("njdd/api/app/version")
    Observable<BaseHttpResponse<VersionBean>> version();

    /**
     * 获取用户信息
     * @return
     */
    @GET("njdd/api/app/companys")
    Observable<BaseHttpListResponse<CompanyBean>> companys();



    @Multipart
    @POST("bgfile/upload")
    Observable<BaseHttpResponse<UploadBean>> uploadFile(@Part List<MultipartBody.Part> partLis);


    /**
     * 更新农机、加油车位置信息。定时调用
     * @return
     */
    @POST("app/api/deviceMgt/updateDeviceLocation")
    Observable<BaseHttpResponse> updateDeviceLocation(@Body RequestBody body);


    @Streaming
    @GET
    Observable<ResponseBody> downloadAPk(@Url String fileUrl);


    /**
     *身份证号识别
     * @return
     */
    @GET()
    Observable<OcrIdBean> ocrIdCard(@Url String fileUrl, @Query("cardNo") String cardNo, @Query("realName") String realName);

    /**
     *身份证照片识别
     * @return
     */
    @FormUrlEncoded
    @POST()
    Observable<OcrIdPhotoBean> ocr(@Url String fileUrl, @Field("base64Str") String base64Str);

    /**
     *身份证照片识别
     * @return
     */
    @POST()
    Observable<JszBean> ocrJsz(@Url String fileUrl, @Body RequestBody body);



    /**
     * 邀请人
     * @return
     */
    @GET("njdd/api/app/user/info/byphone")
    Observable<BaseHttpResponse<UserInfoBean>> byphone(@Query("phone") String phone  );


    /**
     * 登录-注册
     * @return
     */
    @GET("njdd/api/app/promotion/info")
    Observable<BaseHttpResponse<UserInfoBean>> queryInvateCode(@Query("invitationCode") String invitationCode  );

}

